// import { all } from "axios";

let recursionRouters =(menulist=[],
    allRoutes=[])=>{
        // 用于对比后的路由数据
        let userRoutes=[];
      menulist.length>0 && menulist.forEach(menu=>{
    //menu {id: '1', title: 'glsy', name: '管理首页'}

         allRoutes.forEach(route=>{
// route {path: 'welcome', meta: {…}, id: 'welcome', pid: '', component: ƒ}
            if(menu.title===route.meta.title){

                 if(menu.children && menu.children.length>0 ){
                    route.children= recursionRouters(menu.children,route.children)
                  }
                userRoutes.push(route)
            }
            
                
            })
        })
        return userRoutes
    }

    export default recursionRouters